<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html><head>
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath }/css/index.css">
<meta charset="UTF-8">
<title>用户登录-蜗牛图书商城</title>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-3.4.1.js"></script>
</head>
<script>
	window.onload = function () {
		$.get("http://localhost:8080/book/user/findAll", "", function (data) {
			var user = $("#user");
			var str = "";
			var userdata = data.data;
			for (var i in userdata) {
				str += '<tr>'+
							'<td>'+userdata[i].id+'</td>'+
							'<td>'+userdata[i].username+'</td>'+
							'<td>'+userdata[i].password+'</td>'+
							'<td>'+userdata[i].email+'</td>'+
							'<td>'+userdata[i].image+'</td>'+
							'<td>'+userdata[i].status+'</td>'+
							'<td>'+userdata[i].code+'</td>'+
						'</tr>';
			}
			user.append(str);
			console.log(userdata)
		},"json")
	}
</script>
<body>
	<div class="brand_list container_2">
		<div class="header">
		<h1 class="logo">
			<a title="" style="background:url(${pageContext.request.contextPath }/images/logo.png);" href="index.html">电子商务平台</a>
		</h1>
		<ul class="shortcut">
			<li class="first"><a href="${pageContext.request.contextPath }/personal/center">个人中心</a></li>
			<li><a href="myOrders.html">我的订单</a></li>
		</ul>
		<p class="loginfo">
	  		[<a href="login.html">登录</a>
				<a class="reg" href="register.html">免费注册</a>]
	  		
		</p>
	</div>

		<div class="wrapper clearfix">
			<div class="wrap_box">
				<h3 class="notice">已注册用户，请登录</h3>
				<p class="tips">欢迎来到我们的网站，如果您已是本站会员请登录</p>
				<div class="box login_box clearfix">
				
				
					<form action="${pageContext.request.contextPath }/user/login" method="post">
						<span style="color:red">${msg }</span><br>
						<input type="hidden" name="opr" value="login">
						<table width="515" class="form_table f_l">
							<colgroup><col width="120px">
							<col>
							</colgroup><tbody><tr>
								<th>用户名：</th>
								<td><input class="gray" type="text" name="username" id="username" placeholder="请输入用户名"><span id="namemsg"></span></td>
							</tr>
							<tr>
								<th>密码：</th>
								<td><input class="gray" type="password" id="password" name="password" placeholder="请输入6-20位长度的密码"><span id="pwdmsg"></span></td>
							</tr>
							<tr>
								<td></td>
								<td><input class="submit_login" type="submit" value="登录" id="loginbtn"></td>
							</tr>
						</tbody></table>
					</form>
					
					<table id="user" border="1px">
						<tr>
							<th>id</th>
							<th>姓名</th>
							<th>密码</th>
							<th>邮箱</th>
							<th>图片</th>
							<th>状态</th>
							<th>激活码</th>
						</tr>
						<tr>
							<th>===</th>
							<th>===</th>
							<th>===</th>
							<th>===</th>
							<th>===</th>
							<th>===</th>
							<th>===</th>
						</tr>
					</table>

					<!--正常登录时-->
					<table width="360px" class="form_table prompt_3 f_l">
						<colgroup><col width="75px">
						<col>
						</colgroup><tbody><tr>
							<th></th>
							<td>
								<p class="mt_10">
									<strong class="f14">您还不是<span class="orange"></span>用户
									</strong>
								</p>
								<p>
									现在免费注册成为
									
									用户，便能立即享受便宜又放心的购物乐趣。<a class="blue" href="">网站首页&gt;&gt;</a>
								</p>
								<p class="mt_10">
									<a class="reg_btn" href="user?opr=toreg">注册新用户</a>
								</p>
							</td>
						</tr>
					</tbody></table>
				</div>
			</div>
		</div>
		<div class="footer">
		<p class="links">
			<a href="">关于我们</a>|<a href="">常见问题</a>|<a href="">安全交易</a>|<a href="">购买流程</a>|<a href="">如何付款</a>|<a href="">联系我们</a>|<a href="">合作提案</a>
		</p>
		Copyright © 2015-2021 <a class="copyys" target="_blank" href="">蜀ICP备01000010号</a>
	</div>
	</div>

</body></html>